<template>
	<view>
		<view class="intro-card">
			<view class="title-container">
				<view class="section-title">检查描述</view>
				<view class="title-bg"></view>
			</view>
			<view class="intro-text">
				<view>{{ repotDetail.resultDescribe }}</view>
			</view>

			<view class="title-container result">
				<view class="section-title">诊断结果</view>
				<view class="title-bg"></view>
			</view>
			<view class="intro-text">
				<view>{{ repotDetail.itemResult }}</view>
			</view>
		</view>
		<!-- <button class="view-btn"
			@click="previewImage(repotDetail.reportUrl)">查看{{repotDetail.reportTypeName}}报告</button> -->
		<!-- <button class="view-btn" v-else @click="previewImage(repotDetail.reportUrl)">查看超声报告</button> -->
	</view>
</template>

<script>
	import {
		medicalTechnologyReportCheckResult
	} from '../../../../../api/medicalTechnologyReport';
	import {
		uploadPdf
	} from '../../../../../api/upload';
	export default {
		props: {
			repotDetail: {
				type: Object,
				default: () => {}
			}
		},
		data() {
			return {
				detail: {}
			}
		},
		mounted() {
			console.log(this.repotDetail)
			// this.init();
		},
		methods: {
			init() {
				medicalTechnologyReportCheckResult({
					queryValue: this.repotDetail.applyBillNo
				}).then(res => {
					console.log(res)
				})
			},
			previewImage(url) {
				uploadPdf({
					picUrl: url,
					patId: this.repotDetail.patId
				}).then(res => {
					console.log(res)
				})
				// uni.previewImage({
				// 	current: 0, // 当前显示图片的索引
				// 	urls: [this.hostApi + url], // 需要预览的图片链接列表
				// 	indicator: 'default' // 图片指示器样式
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.intro-card {
		background: #fff;
		border-radius: 16rpx;
		padding: 20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
	}

	.title-container {
		position: relative;
		margin-bottom: 20rpx;
		padding-left: 10rpx;
	}

	.result {
		margin-top: 20rpx;
	}

	.section-title {
		position: relative;
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
		z-index: 1;
	}

	.title-bg {
		position: absolute;
		width: 68rpx;
		height: 15rpx;
		background-color: rgba(65, 207, 230, 0.5);
		bottom: -2rpx;
		left: 39rpx;
		z-index: 0
	}

	.intro-text {
		font-size: 28rpx;
		color: #666;
		padding: 0 20rpx;
		line-height: 1.6;
	}

	.view-btn {
		width: 90%;
		margin: 60rpx 5% 0 5%;
		height: 86rpx;
		background: linear-gradient(90deg, #6ed6f7 0%, #3ec6e7 100%);
		color: #fff;
		font-size: 30rpx;
		border-radius: 44rpx;
		text-align: center;
		line-height: 86rpx;
		box-shadow: 0 4rpx 12rpx rgba(65, 207, 230, 0.15);
		border: none;
		margin-bottom: 12rpx;
	}
</style>